# Maintainer : Daniel Bermond <dbermond@archlinux.org>
# Contributor: Uffe Jakobsen <uffe@uffe.org>
# Contributor: Guilherme Calé <gui@cabritacale.eu>

pkgname=fs-uae-launcher
pkgver=3.1.68
pkgrel=2
pkgdesc='Graphical user interface for the fs-uae Amiga emulator'
arch=('any')
url='https://fs-uae.net/launcher/'
license=('GPL2')
depends=('fs-uae' 'python' 'python-opengl' 'python-pillow' 'python-pyqt5'
         'python-requests' 'python-rx' 'python-setuptools' 'python-typing_extensions'
         'hicolor-icon-theme')
optdepends=('p7zip: for .7z file support'
            'python-lhafile: for .lha file support')
source=("https://fs-uae.net/files/FS-UAE-Launcher/Stable/${pkgver}/${pkgname}-${pkgver}.tar.xz"
        '010-fs-uae-launcher-fix-install-path.patch'
        '020-fs-uae-launcher-remove-python2.patch')
sha256sums=('e36104442db278e0f1d073dbc2be2f9a937cd33e964968b75b324c393f8ec030'
            '4ec36185146f46286a6168162837605e1e2cbb6f4e405996d7f6373bf29fac6f'
            'f0616c0d181733120c68fea2f158eb27e90c3f07c23cd93b042a5ae240cfdd5e')

prepare() {
    patch -d "${pkgname}-${pkgver}" -Np1 -i "${srcdir}/010-fs-uae-launcher-fix-install-path.patch"
    patch -d "${pkgname}-${pkgver}" -Np1 -i "${srcdir}/020-fs-uae-launcher-remove-python2.patch"
}

build() {
    make -C "${pkgname}-${pkgver}" all
}

package() {
    make -C "${pkgname}-${pkgver}" DESTDIR="$pkgdir" prefix='/usr' install
    rm "${pkgdir}/usr/share/doc/${pkgname}/COPYING"
}
